package com.hzw.saas.service.rss.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzw.saas.service.rss.model.JournalCustom;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * <p>
 * 期刊站点 Mapper 接口
 * </p>
 *
 * @author sonam
 * @since 2021-06-30
 */
@Mapper
public interface JournalCustomMapper extends BaseMapper<JournalCustom> {

    @Delete("<script> delete from tb_journal_custom where pid = #{pid}</script>")
    void deleteByPid(@Param("pid") String pid);

    @Delete("<script> delete from tb_journal_custom where catalog_id in <foreach item=\"catalogId\" collection=\"catalogIds\"  open=\"(\" separator=\",\" close=\")\"> #{catalogId} </foreach> </script>")
    int deleteByCatalogIds(@Param("catalogIds") List<String> catalogIds);


    @Delete("<script> delete from tb_journal_custom where user_id = #{userId}</script>")
    void deleteByUserId(@Param("userId") String userId);
}
